﻿using System.Data;
using CoreEx.Common.Proxy;
using CoreEx.Database.Client;
using LinFu.Proxy.Interfaces;
using LinFu.IoC;
namespace CoreEx.Database.Client.Implementation
{
    public class ConnectionProxyFactory : ProxyFactory<IDbConnection>
    {
        public override IDbConnection CreateProxy(IDbConnection actualTarget)
        {
            return _proxyFactory.CreateProxy<IDbConnection>(_serviceContainer.GetService<IInvokeWrapper<IDbConnection>>(actualTarget), new []{typeof(IActualTarget),typeof(IDbConnectionInfo)});
        }
    }
}
